fix(install): honor ID_LIKE when selecting the driver install distro (EAI-7406)#116
Open
michaelroy-amd wants to merge 1 commit into
Open
fix(install): honor ID_LIKE when selecting the driver install distro (EAI-7406)#116michaelroy-amd wants to merge 1 commit into
michaelroy-amd wants to merge 1 commit into
Conversation
`build_driver_install_plan` matched only the `/etc/os-release` `ID` field, so Debian/Ubuntu-family and RHEL-rebuild derivatives that reuse their base version scheme (e.g. Pop!_OS, AlmaLinux) fell through to the `unsupported_linux_dkms_plan`, even though the OpenMPI and system dependency plans in `rocm_core::openmpi` already resolve the family via `ID_LIKE`. Add an `ID_LIKE` fallback used only when the exact `(ID, VERSION_ID)` match fails: - Ubuntu-family (`ID_LIKE` names `ubuntu`) reusing 22.04/24.04 -> the Ubuntu apt plan (`ubuntu/<codename>` repo). - Debian-family (`ID_LIKE` names `debian`) at 12/13 -> the Debian apt plan. - RHEL rebuilds (`ID_LIKE` names `rhel`, e.g. AlmaLinux) at an AMD-documented EL version -> a new `DnfDriverDistro::Generic` served from the vendor-neutral `el/` repo path with standard RHCK kernel commands. The fallback is gated to AMD-documented versions, so version-misaligned derivatives (Linux Mint 22, Kali) still fall through to unsupported rather than fabricating a repository URL. Oracle Linux (UEK kernel, `ID_LIKE=fedora`) and openSUSE Leap (no SUSEConnect entitlement) are excluded so they never receive a broken plan. `dnf_repo_version_path` is generalized to key on the major version (EL 8/10 use the major path, EL 9 the point release), which is behavior-preserving for every previously-reachable RHEL/Oracle/Rocky input and correct for EL rebuilds. Refs EAI-7406 Signed-off-by: Michael Roy <michael.roy@amd.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rocm install driverselects a distro-specific install plan inbuild_driver_install_plan. It matched only the/etc/os-releaseIDfield and ignoredID_LIKE, so Debian/Ubuntu-family and RHEL-rebuild derivatives that reuse their base version scheme (e.g. Pop!_OS, AlmaLinux) fell through to theunsupported_linux_dkms_plan— even though the OpenMPI and system-dependency plans inrocm_core::openmpialready resolve the package family viaID_LIKE. This is the EAI-7406 "Debian-to-Ubuntu/EL matching" defect.Root cause
Exact
(ID, VERSION_ID)matching with noID_LIKEfallback. Verified against AMD's live docs (rocm.docs.amd.com, ROCm 7.2.x): the existing codename values (Debian 12→jammy, 13→noble) and EL repo paths were already correct — the gap was purely that non-exact-IDfamily members were never matched.Fix (one file:
apps/rocm/src/main.rs)Add
driver_plan_via_id_like, used only when the exact(ID, VERSION_ID)match fails (exact matches are untouched):ID_LIKEnamesubuntu) reusing 22.04/24.04 → the Ubuntu apt plan (ubuntu/<codename>repo).ID_LIKEnamesdebian) at 12/13 → the Debian apt plan.ID_LIKEnamesrhel, e.g. AlmaLinux) at an AMD-documented EL version → newDnfDriverDistro::Generic, served from the vendor-neutralel/repo path with standard RHCK kernel commands.dnf_repo_version_pathis generalized to key on the major version (EL 8/10 use the major path, EL 9 the point release) — behavior-preserving for every previously-reachable RHEL/Oracle/Rocky input, and correct for EL rebuilds.The fallback is gated to AMD-documented versions, so version-misaligned derivatives (Linux Mint 22, Kali) still fall through to unsupported rather than fabricating a repo URL.
Safety-critical exclusions (found by adversarial review)
Two independent adversarial reviewers caught two regressions in an earlier revision of this change; both are fixed and now covered by regression tests:
ID_LIKE=fedora(notrhel) and boots the UEK kernel. It is excluded from the EL fallback (gated onmentions("rhel")+ an explicitol/oracleguard) so it keeps its dedicated UEK flow and never gets RHCK kernel commands.SUSEConnectentitlement. The SUSE fallback branch was removed entirely so Leap stays unsupported instead of receiving a broken SLES plan.A third fresh adversarial pass verified both fixes and found no new defects.
Known limitation (out of scope)
Ubuntu derivatives with their own version scheme that expose
UBUNTU_CODENAMEbut a non-UbuntuVERSION_CODENAME(e.g. Linux Mintwilma/22) are not matched here — matching them safely would require codename-preference logic beyond this fix and is left as a follow-up. They fail safe (unsupported).Test plan
cargo test --workspace -- --test-threads=1: 1444 passed, 0 failed.cargo clippy --all-targets -- -D warnings: clean.cargo fmt --check: clean.python scripts/smoke_local.py: ok.Refs EAI-7406